﻿using SqlSugar;
using System;
using System.ComponentModel.DataAnnotations;

namespace EShop.Net.Model.Entity
{
    /// <summary>
    /// 类    名：UserInfo
    /// 功能描述：用户表
    /// 创 建 人：十一
    /// 创建时间：2022/11/7 22:10:41
    /// </summary>
    [SugarTable("t_userInfo", TableDescription = "用户表")]
    // 创建索引(唯一索引)
    [SugarIndex("unique_openId", nameof(UserInfo.openId), OrderByType.Desc, true)]
    public class UserInfo
    {
        [Display(Name = "自增ID种子1")]
        [SugarColumn(ColumnDescription = "用户ID", IsPrimaryKey = true, IsIdentity = true)]
        public int id { get; set; }

        [SugarColumn(ColumnDescription = "身份证号", IsNullable = true)]
        [StringLength(18, ErrorMessage = "【{0}】不能超过{1}字符长度")]
        public String idCard { get; set; }

        [SugarColumn(ColumnDescription = "手机号", IsNullable = true)]
        [StringLength(15, ErrorMessage = "【{0}】不能超过{1}字符长度")]
        public String userPhone { get; set; }

        [SugarColumn(ColumnDescription = "openId")]
        public String openId { get; set; }

        [SugarColumn(ColumnDescription = "缓存key")]
        public String sessionKey { get; set; }

        [SugarColumn(ColumnDescription = "unionId", IsNullable = true)]
        public String unionId { get; set; }

        [SugarColumn(ColumnDescription = "昵称", IsNullable = true)]
        [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")]
        public String nickName { get; set; }

        [SugarColumn(ColumnDescription = "头像", IsNullable = true)]
        public String avatarImage { get; set; }

        [SugarColumn(ColumnDescription = "性别[1男2女3未知]")]
        public int gender { get; set; }

        [SugarColumn(ColumnDescription = "生日", IsNullable = true)]
        public DateTime? birthday { get; set; }

        [SugarColumn(ColumnDescription = "省", IsNullable = true)]
        [StringLength(80, ErrorMessage = "【{0}】不能超过{1}字符长度")]
        public String province { get; set; }

        [SugarColumn(ColumnDescription = "城", IsNullable = true)]
        [StringLength(80, ErrorMessage = "【{0}】不能超过{1}字符长度")]
        public String city { get; set; }

        [SugarColumn(ColumnDescription = "区", IsNullable = true)]
        [StringLength(80, ErrorMessage = "【{0}】不能超过{1}字符长度")]
        public String district { get; set; }

        [SugarColumn(ColumnDescription = "积分", IsNullable = true)]
        public int? integral { get; set; }

        [SugarColumn(ColumnDescription = "等级[1-10]", IsNullable = true)]
        public int? grade { get; set; }

        [SugarColumn(ColumnDescription = "创建时间[时间戳]")]
        public long? createTime { get; set; }

        [SugarColumn(ColumnDescription = "更新时间[时间戳]", IsNullable = true)]
        public long? updateTime { get; set; }

        [SugarColumn(ColumnDescription = "状态[0-正常，1-禁用]")]
        public int status { get; set; }
    }
}
